<template>
	<scroll-view scroll-y class="scrollPage">
		<cu-custom bgColor="bgmain" :isBack="true">
			<view slot="content">推广订单列表</view>
		</cu-custom>

		<!-- 数据列表 -->
		<block v-if="dataList.length>0">
			<view class="margin-lg flex align-center justify-between padding list" v-for="(item,index) in dataList" :key="index">
				<view class="text-lg text-black" style="flex-grow: 1;">
					<view class="text-df text-bold flex align-center">
						<!-- <image src="../../../static/images/user/balance.png"></image> -->
						订单号：{{item.ordersn}}
					</view>
					<view class="text-sm date">{{item.createtime}}</view>
				</view>
				<view class="text-xl text-bold text-red">+{{item.d_money}}</view>
			</view>
		</block>
		<block v-else>
			<view class="text-lg text-center margin-top">暂无相关数据~</view>
		</block>
		

	</scroll-view>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				page:1,
				is_loadmore:true,
				dataList:[],
			}
		},
		onLoad() {
			this.getLst()
		},
		onReachBottom() {
			if(this.is_loadmore)
			{
				this.page++
				this.getLst()
			}
			else{
				uni.showToast({
					title:'没有更多数据~',
					icon:'none'
				})
			}
		},
		methods: {
			getLst() {
				const self = this;
				app.globalData.util.request({
					url: 'Dumpling/order',
					data: {
						limit:10,
						page:self.page,
					},
					success(res) {
						console.log("打印",res.data.data)
						if(res.data.data.data.length<10)
						{
							self.is_loadmore = false
						}
						self.dataList = self.page==1?res.data.data.data:[
							...self.dataList,...res.data.data.data
						]
					}
				}, true);
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F5F6;
	}

	.bgmain {
		background-color: white;
		color: black;
	}

	.type_box {
		background-color: #F9F9F9;
		font-size: 26rpx;
		height: 60rpx;
		padding: 0 40rpx;
		border-radius: 30rpx;
		align-items: center;
		display: flex;

		text {
			font-size: 36rpx !important;
		}
	}
	.type_item{
		background-color: #F2F2F2;
		height: 120rpx;
		width: 210rpx;
		text-align: center;
		line-height: 120rpx;
		margin-right: 20rpx;
		border-radius: 10rpx;
	}
	.cu-dialog{
		bottom: 0;
		position: absolute;
		width: 100%;
		display: block;
		background-color: white !important;
	}
	.type_active{
		background: #FEEDED;
		border: 2rpx solid #FF4C4D;
		border-radius: 10rpx;
		color: #FF4C4D;
	}
	.list{
		border-radius: 10rpx;
		background-color: white;
		image{
			width: 35rpx;
			height: 35rpx;
			margin-right: 15rpx;
			flex-shrink: 0;
		}
		.date{
			color: #A9A6B0;
			// margin: 16rpx 0 0 55rpx;
			margin: 16rpx 0 0 0;
		}
	}
	.menu{
		font-size: 30rpx;
		.menu_item{
			margin-right: 30rpx;
			position: relative;
		}
		.active{
			color: #e54d42 !important;
			font-size: 32rpx;
		}
		.active::after{
			content: '';
			position: absolute;
			width: 50rpx;
			height: 6rpx;
			background-color: #e54d42;
			bottom: -10rpx;
			left: 0;
			right: 0;
			margin: 0 auto;
		}
	}
</style>
